package com.javaee.term.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.javaee.term.Enums.ContactStatusEnum;
import com.javaee.term.Enums.LogistStatusEnum;
import com.javaee.term.utils.EnumUtil;

import java.text.DateFormat;
import java.util.Date;
import javax.persistence.*;

@Table(name = "logist_info")
public class LogistInfo {
    /**
     * 物流信息主键
     */
    @Id
    @Column(name = "logist_id")
    private String logistId;

    @Column(name = "send_id")
    private String sendId;

    @Column(name = "logist_company")
    private String logistCompany;

    /**
     * 物流信息：已揽件0 运输中1 已签收2
     */
    @Column(name = "logist_status")
    private Integer logistStatus;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 获取物流信息主键
     *
     * @return logist_id - 物流信息主键
     */
    public String getLogistId() {
        return logistId;
    }

    /**
     * 设置物流信息主键
     *
     * @param logistId 物流信息主键
     */
    public void setLogistId(String logistId) {
        this.logistId = logistId == null ? null : logistId.trim();
    }

    /**
     * @return send_id
     */
    public String getSendId() {
        return sendId;
    }

    /**
     * @param sendId
     */
    public void setSendId(String sendId) {
        this.sendId = sendId == null ? null : sendId.trim();
    }

    /**
     * @return logist_company
     */
    public String getLogistCompany() {
        return logistCompany;
    }

    /**
     * @param logistCompany
     */
    public void setLogistCompany(String logistCompany) {
        this.logistCompany = logistCompany == null ? null : logistCompany.trim();
    }

    /**
     * 获取物流信息：已揽件0 运输中1 已签收2
     *
     * @return logist_status - 物流信息：已揽件0 运输中1 已签收2
     */
    public Integer getLogistStatus() {
        return logistStatus;
    }

    /**
     * 设置物流信息：已揽件0 运输中1 已签收2
     *
     * @param logistStatus 物流信息：已揽件0 运输中1 已签收2
     */
    public void setLogistStatus(Integer logistStatus) {
        this.logistStatus = logistStatus;
    }

    /**
     * 获取创建时间
     *
     * @return create_time - 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置创建时间
     *
     * @param createTime 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @JsonIgnore
    public  String getStringCreate(){
        DateFormat df5_1 = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
        return  df5_1.format(createTime);
    }
    @JsonIgnore
    public  String getStringCreate(String T){
        return  createTime.toString();
    }


    @JsonIgnore
    public LogistStatusEnum getLogistStatusEnum() {
        return EnumUtil.getByCode(logistStatus, LogistStatusEnum.class);
    }

}